<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>

<title>任务列表</title>

<script type="text/javascript">

 var currentTaskId="";
 var currentEventId="";

    function setCurrentTaskId(id,eventId){
    currentTaskId=id;
    currentEventId=eventId;
    }

    /**
	 *  打开任务详细
	 */
	function openTaskDetail(){
	if(currentTaskId == ""){
	   Alert('请选择一条记录!');
	   return false;
	  }
		var url = "${ctx}/customerService_deptCooperationAction.do?method=navigateTaskDetail&customerTaskId="+currentTaskId;
		top.windowOpen(url, "openTaskDetail", "任务详细信息", 450, 850,true,"openTaskDetail");

	}

	/**
	 * 打开派工单管理
	 */
	function openDispatchMain(){
	  	var url = "${ctx}/customerService_dispatchFormAction.do?method=dispatchFormCommonMain&customerEventId=${customerEventId}&taskId="+currentTaskId;
	 top.windowOpen(url, "openDispatchMain", "派工单管理", 480, 950,true,"openDispatchMain");
	}

	/**
	 *  打开任务回撤
	 */
	function openBackTask(){
	if(currentTaskId == ""){
	   Alert('请选择一条记录!');
	   return false;
	  }

	   var urll = "${ctx}/customerService_deptCooperationAction.do?method=checkCancelTaskIsTrue&submitTaskid="+currentTaskId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var url = "${ctx}/customerService_deptCooperationAction.do?method=navigateTaskRevoke&customerTaskId="+currentTaskId+"&custServiceEventId="+currentEventId;
		top.windowOpen(url, "revokeTask", "撤回", 270, 410,true,"revokeTask");


		}}
	 );

	}

	/**
	 * 打开任务完工 页面提示
	 */
	function openTaskComplete(){
	if(currentTaskId == ""){
	   Alert('请选择一条记录!');
	   return false;
	  }

	  var urll = "${ctx}/customerService_deptCooperationAction.do?method=checkDeptReplyIsTrue&submitTaskid="+currentTaskId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var url = "${ctx}/customerService_deptCooperationAction.do?method=navigateAccomplishRegister&customerTaskId="+currentTaskId+"&custServiceEventId="+currentEventId;
		top.windowOpen(url, "taskComplete", "任务完成", 270, 410,true,"taskComplete");


		}}
	 );

	}

	 /**
	 * 打开任务处理意见
	 */
	function addProcessingOpinion(){
	if(currentTaskId == ""){
	   Alert('请选择一条记录!');
	   return false;
	  }

	  var urll = "${ctx}/customerService_deptCooperationAction.do?method=checkEditTaskIsTrue&submitTaskid="+currentTaskId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var url = "${ctx}/customerService_deptCooperationAction.do?method=navigateProcessingOpinionRegister&customerTaskId="+currentTaskId;
		top.windowOpen(url, "addProcessingOpinion", "处理意见", 230, 550,true,"addProcessingOpinion");

		}}
	 );

	}

    /**
	 * 打开任务反馈信息
	 */
	function addTaskFeedbackInfo(){
	if(currentTaskId == ""){
	   Alert('请选择一条记录!');
	   return false;
	  }

	  var urll = "${ctx}/customerService_deptCooperationAction.do?method=checkEditTaskIsTrue&submitTaskid="+currentTaskId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var url = "${ctx}/customerService_deptCooperationAction.do?method=navigateTaskFeedback&customerTaskId="+currentTaskId;
		top.windowOpen(url, "addTaskFeedbackInfo", "反馈信息", 230, 550,true,"addTaskFeedbackInfo");

		}}
	 );

	}

	/**
	 * 打开任务崔单提示
	 */
	function openTaskHasten(){
	if(currentTaskId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }

	  var urll = "${ctx}/customerService_deptCooperationAction.do?method=checkHastenIsTrue&submitTaskid="+currentTaskId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		 AskConfirm("您确定发送任务催单吗？","customerTaskFrame","${ctx}/customerService_deptCooperationAction.do?method=hasten&customerTaskId="+currentTaskId);

		}}
	 );

	}

	/**
	 * 打开关联事件
	 */
	function openLinkTheOther(){
	var url = "${ctx}/customerService_custServEventAction.do?method=initLinkTheOtherListMain&keyword="+currentEventId;
	top.windowOpen(url,"linkTheOther","关联事件列表",450,900,true,"linkTheOtherFrame");
    }

	/**
	 * 查询任务列表
	 */
	function searchCustomer(){
	   document.searchCustomerTask.submit();
	}
	/**
	 * 刷新列表 这里以后再修改成查询列表方法
	 */
	function refleshFrame(){
	    currentTaskId='';
	    currentEventId='';
		var url = "${ctx}/customerService_deptCooperationAction.do?method=queryTaskByPage&customerEventId=${customerEventId}";
		document.getElementById("customerTaskList").src = url;
	}

</script>
</head>

<body>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg">
    	<table border="0" cellpadding="0" cellspacing="0">
	      <tr>
	        <td><span class="window_head_intext"><img src="${ctx}/images/ico_Advance.gif" align="absmiddle" />&nbsp;任务列表</span></td>
	      </tr>
    	</table>
    </td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
<tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td  class="content">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td bgcolor="#FFFFFF" border="0" cellspacing="0" cellpadding="0">
	        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#BCBFD2" >
	          <tr>
	            <td>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
      <td class="bg_search">
	  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td class="bg_search">
      <table border="0" cellpadding="0" cellspacing="1" id="search01">
       <form action="${ctx}/customerService_deptCooperationAction.do?method=queryTaskByPage"
	   		 id="searchCustomerTask" name="searchCustomerTask" method="post" target="customerTaskList">
        <tr>
          <td class="td_search">责任部门：</td>
          <td class="td_search">
          	<input name="deptName" type="text" class="inputtext" size="16" />
          </td>
          <td class="td_search">任务状态：</td>
          <td class="td_search"><pms:unitedSelect id="statuz"
                            selectText="请选择..."
							name="statuz"
							dataList="${statuList}"
							optionLabel="name"
							optionValue="value" >
			</pms:unitedSelect></td>
          <td class="td_search">&nbsp;</td>
          <td class="td_search"><table border="0" cellpadding="0" cellspacing="0" >
              <tr>
                <td class="buttonOffLeft" id="btn1_11">
                <input type="hidden" name="customerEventId" value="${customerEventId}">
                </td>
                <td class="buttonOffMiddle" id="btn1_12"
                	onblur="btn_change(1)"
                	onMouseOver="btn_change_over(1)"
                	onMouseOut="btn_change_out(1)"
                	onclick="searchCustomer();">
                	<img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle" /> 查
                  询</td>
                <td class="buttonOffRight" id="btn1_13"></td>
              </tr>
          </table></td>
        </tr>
        </form>
      </table></td>
        </tr>
      </table>
	  	  </td>
    </tr>
    <tr>
      <td class="bg_toolBar">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="35%">&nbsp;</td>
          <td width="65%" align="right"></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td valign="top">
		<iframe id="customerTaskList"  name="customerTaskList" height="300px" frameborder="0" border="0" src="${ctx}/customerService_deptCooperationAction.do?method=queryTaskByPage&customerEventId=${customerEventId}" width="100%" ></iframe>
      </td>
    </tr>
  </table>

</td>
     </tr>
        </table></td>
    </tr>
  </table>

</td>
  </tr>
  <tr>
    <td colspan="2" class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
        <tr><td><table border="0"  cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
    </table>      </td>
	       <td class="btn_between_space"></td>

          <td class="btn_between_space"></td>
          <td>
          	<table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="buttonOffLeft" id="btn1_31"></td>
                <td class="buttonOffMiddle"
                	id="btn1_32"
                	onClick="windowClose();"
                	onMouseOver="btn_change_over(3)"
                	onMouseOut="btn_change_out(3)"
                	onBlur="btn_change(3)">
                	<img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 关 闭</td>
                <td class="buttonOffRight" id="btn1_33"></td>
              </tr>
          </table></td>
        </tr>
          </table>
      <p>&nbsp;</p></td>
  </tr>
</table>
</div>
</body>
</html>
